Welcome in the PCTG R Markdown template. Here are a few lines of code and text to give an overview of how R Markdown works.
Let’s load a GWAS summary statistic stored in the qqman library. This library is:
library(qqman)
library(DT)
datatable(gwasResults, rownames = FALSE, filter="top", options = list(pageLength = 5, scrollX=T) )
# Make the plot
p <- ggplot(don, aes(x=BPcum, y=-log10(P), text=text)) +
# Show all points
geom_point( aes(color=as.factor(CHR)), alpha=0.8, size=1.3) +
scale_color_manual(values = rep(c("grey", "skyblue"), 22 )) +
# custom X axis:
scale_x_continuous( label = axisdf$CHR, breaks= axisdf$center ) +
scale_y_continuous(expand = c(0, 0) ) + # remove space between plot area and x axis
# Add highlighted points
geom_point(data=subset(don, is_highlight=="yes"), color="orange", size=2) +
# Custom the theme:
theme_bw() +
theme(
legend.position="none",
panel.border = element_blank(),
panel.grid.major.x = element_blank(),
panel.grid.minor.x = element_blank()
) +
ylim(0, 10)
ggplotly(p, tooltip="text")
Created by Yan Holtz, adapted by Florian Rohart